unit psdict;
interface
Var
   psdef : array[1..1500] of string[200];
procedure get_psdefs(Var nl: integer);

implementation
procedure get_psdefs(Var nl :integer);
Var n : integer;
begin
   n:=0;
   n:=n+1; psdef[n]:='/box{moveto lineto lineto lineto closepath} def %%%% filled rect';
   n:=n+1; psdef[n]:='/m {moveto} def             %%%% moveto';
   n:=n+1; psdef[n]:='/sg {setgray} def           %%%% graylevel';
   n:=n+1; psdef[n]:='/g {setgray fill} def       %%%% graylevel+fill';
   n:=n+1; psdef[n]:='/s {stroke} def             %%%% stroke';
   n:=n+1; psdef[n]:='/C {newpath 0 360 arc closepath} bind def  %%%% circle';
   n:=n+1; psdef[n]:='/L {moveto lineto stroke} bind def   %%%% line';
   n:=n+1; psdef[n]:='/w {setlinewidth} bind def        %%%% linewidth';
   n:=n+1; psdef[n]:='/sd {setdash} bind def  %%%% {[len_black len_white ...] offset} ;dash pattern';
   n:=n+1; psdef[n]:='/rgb {setrgbcolor fill} bind def   %%%% rgb color';
   n:=n+1; psdef[n]:='/mr {rmoveto} def';
   n:=n+1; psdef[n]:='/lt {lineto} def';
   n:=n+1; psdef[n]:='/lr {rlineto} def';
   n:=n+1; psdef[n]:='/defport{1 w 8 copy m lt lt lt closepath clip  8 copy m lt lt lt closepath 1 g m lt lt lt closepath 0 setgray s}def';
   n:=n+1; psdef[n]:='/mypt{2.5 mul sca mul} bind def %%%% scales triangle';
   n:=n+1; psdef[n]:='/tri {/sca exch def m -0.5 mypt -0.2887 mypt mr 1.0 mypt 0.0 lr -0.5 mypt 0.8660 mypt lr -0.5 mypt -0.8660 mypt lr} def';
   n:=n+1; psdef[n]:='/trid {/sca exch def m 0.5 mypt 0.2887 mypt mr -1.0 mypt 0.0 lr 0.5 mypt -0.8660 mypt lr 0.5 mypt 0.8660 mypt lr} def';
   n:=n+1; psdef[n]:='/cro {/sca exch def m -0.3536 mypt -0.3536 mypt mr 0.7071 mypt 0.7071 mypt lr 0 -0.7071 mypt mr -0.7071 mypt 0.7071 mypt lr stroke} def';
   n:=n+1; psdef[n]:='/sq {/sca exch def m -0.5 mypt -0.5 mypt mr 1 mypt 0 lr 0 1 mypt lr -1 mypt 0 lr 0 -1 mypt lr} def';
   n:=n+1; psdef[n]:='/diam {/sca exch def m -0.7 mypt 0 mr 0.7 mypt 0.7 mypt lr 0.7 mypt -0.7 mypt lr -0.7 mypt -0.7 mypt lr -0.7 mypt 0.7 mypt lr} def';
   n:=n+1; psdef[n]:='/plus {/sca exch def m -0.5 mypt 0 mr 1 mypt 0 lr -0.5 mypt 0.5 mypt mr 0 -1 mypt lr stroke} def';
   n:=n+1; psdef[n]:='/r4{4 1 roll}def';
   n:=n+1; psdef[n]:='/sizerect{3 add r4 3 add r4 2 neg add r4 2 neg add r4}def';
   n:=n+1; psdef[n]:='/sizerects{11 add r4 8 add r4 0 add r4 -5 add r4}def';
   n:=n+1; psdef[n]:='/sizerectperp{10 add r4 5 add r4 5 neg add r4 5 neg add r4}def';
   n:=n+1; psdef[n]:='/strshow1{gsave translate 0 0 m dup false charpath flattenpath pathbbox sizerect 0.9 0.9 0.3 rgb rectfill 0 setgray 0 0 m show grestore}def';
   n:=n+1; psdef[n]:='/strshow1x{gsave translate 0 0 m dup false charpath flattenpath pathbbox sizerect 1 0 0 rgb rectfill 0 setgray 0 0 m show grestore}def';
   n:=n+1; psdef[n]:='/strshow2{gsave translate 0 0 m dup false charpath flattenpath pathbbox sizerect 1 setgray 1.2 mul 4 copy rectfill 1 setgray rectstroke 0 setgray 0 0 m show grestore}def';
   n:=n+1; psdef[n]:='/strshow2x{gsave translate 0 0 m dup false charpath flattenpath pathbbox sizerect 0.9 0.9 0.9 rgb 1.2 mul 4 copy rectfill 1 setgray rectstroke 0 setgray 0 0 m show grestore}def';
   n:=n+1; psdef[n]:='/strshow3{gsave translate 0 0 m dup false charpath flattenpath pathbbox sizerect 1 0.6 0.9 rgb rectfill 0 setgray 0 0 m show grestore}def';
   n:=n+1; psdef[n]:='/strshows{gsave translate 0 0 m dup false charpath flattenpath pathbbox sizerects 4 copy 1 0.7 0.7 rgb rectfill 0 setgray 1 w rectstroke 0 0 m 0 setgray show grestore}def';
   n:=n+1; psdef[n]:='/strshowperp{gsave translate 0 0 m dup false charpath flattenpath pathbbox sizerectperp 4 copy 1 0.9 0.9 rgb rectfill 0 setgray 1 w rectstroke 0 0 m 0 setgray show grestore}def';

   n:=n+1; psdef[n]:=' ';
   n:=n+1; psdef[n]:='%%% ARROW: X_tail, Y_tail, X_tip, Y_tip, w_tail, w_arrow, l_arrow';
   n:=n+1; psdef[n]:='%%% from PostScript Cook-book, p.13';
   n:=n+1; psdef[n]:='/arrowdict 14 dict def';
   n:=n+1; psdef[n]:='arrowdict begin';
   n:=n+1; psdef[n]:=' /mtrx matrix def';
   n:=n+1; psdef[n]:='end';
   n:=n+1; psdef[n]:='/arrow';
   n:=n+1; psdef[n]:=' { arrowdict begin';
   n:=n+1; psdef[n]:='    /headlength exch def';
   n:=n+1; psdef[n]:='    /halfheadthickness exch 2 div def';
   n:=n+1; psdef[n]:='    /halfthickness exch 2 div def ';
   n:=n+1; psdef[n]:='    /tipy exch def /tipx exch def';
   n:=n+1; psdef[n]:='    /taily exch def /tailx exch def';
   n:=n+1; psdef[n]:='    /dx tipx tailx sub def';
   n:=n+1; psdef[n]:='    /dy tipy taily sub def';
   n:=n+1; psdef[n]:='    /arrowlength dx dx mul dy dy mul add sqrt def';
   n:=n+1; psdef[n]:='    /angle dy dx atan def';
   n:=n+1; psdef[n]:='    /base arrowlength headlength sub def';
   n:=n+1; psdef[n]:='    /savematrix mtrx currentmatrix def';
   n:=n+1; psdef[n]:='    tailx taily translate';
   n:=n+1; psdef[n]:='    angle rotate';
   n:=n+1; psdef[n]:='    0 halfthickness neg moveto';
   n:=n+1; psdef[n]:='    base halfthickness neg lineto';
   n:=n+1; psdef[n]:='    base halfheadthickness neg lineto';
   n:=n+1; psdef[n]:='    arrowlength 0 lineto';
   n:=n+1; psdef[n]:='    base halfheadthickness lineto';
   n:=n+1; psdef[n]:='    base halfthickness lineto';
   n:=n+1; psdef[n]:='    0 halfthickness lineto';
   n:=n+1; psdef[n]:='    closepath';
   n:=n+1; psdef[n]:='    savematrix setmatrix';
   n:=n+1; psdef[n]:='   end';
   n:=n+1; psdef[n]:=' } def';
   n:=n+1; psdef[n]:='%% EXAMPLE';
   n:=n+1; psdef[n]:='%% newpath';
   n:=n+1; psdef[n]:='%% 318 340 72 340 10 30 72 arrow fill';
   n:=n+1; psdef[n]:='%% newpath';
   n:=n+1; psdef[n]:='%% 382 400 542 560 72 232 116 arrow 3 w s';
   n:=n+1; psdef[n]:='%% showpage';
   n:=n+1; psdef[n]:='%%%%%%%%%%%%%  END_ARROW';
   nl:=n;
end;

end.
